#include "Container.h"
#include "Container.cpp"




void Test_Stack()
{
    //Stack<int ,Vector<int> > S1;
    Stack<int ,Vector > S1;
    S1.Push(1);
    S1.Push(2);
    S1.Push(3);
    S1.Push(4);
    S1.Push(5);
    cout<<"显示栈中元素"<<endl;
    S1.Display();
    //Stack<int ,Vector<int> > S2(S1);//注意这里后面的空格
    Stack<int ,Vector> S2(S1);

    S2.Display();
    int top=0;
    bool ret=S2.Top(top);
    if(ret==0)
    {
        cout<<"栈为空"<<endl;
    }
    else
    {
        cout<<"栈顶:"<<top<<endl;
    }
    cout<<"出栈3个元素"<<endl;
    S2.Pop();
    S2.Pop();
    S2.Pop();
    S2.Display();
}
void Test_Queue()
{
    //Queue<int ,List<int> > Q1;
    Queue<int ,List > Q1;
    Q1.Push(1);
    Q1.Push(2);
    Q1.Push(3);
    Q1.Push(4);
    Q1.Push(5);
    cout<<"显示队列元素"<<endl;
    Q1.Display();
    //Queue<int ,List<int> > Q2(Q1);
    Queue<int ,List> Q2(Q1);

    Q2.Display();
    int top=0;
    bool ret=Q2.Front(top);
    if(ret==0)
    {
        cout<<"队列为空"<<endl;
    }
    else
    {
        cout<<"对头:"<<top<<endl;
    }
    cout<<"出队列3个元素"<<endl;
    Q2.Pop();
    Q2.Pop();
    Q2.Pop();
    Q2.Display();
    Q2.Pop();
    Q2.Pop();
    cout<<"再出队列2个元素"<<endl;
    ret=Q2.Front(top);
    if(ret==0)
    {
        cout<<"队列为空"<<endl;
    }
    else
    {
        cout<<"对头:"<<top<<endl;
    }
}


int main()
{
    Test_Stack();
    Test_Queue();
    return 0;
}
